<?php

namespace common\models\cb;

class CBInvoke
{
    static function compute(callable $operation, $x, $y)
    {
        return $operation($x, $y);
    }

    static function processWithLogging(callable $logFunc, $data)
    {
        $logFunc("开始处理数据: " . json_encode($data));
        // 处理数据...
        $logFunc("数据处理完成");
    }

    static function transformString($str, callable $transformer)
    {
        return $transformer($str);
    }

    static function applyOperation($value, callable $operation)
    {
        return $operation($value);
    }

    public function getWelcomeMessage()
    {
        return "欢迎加入我们的服务！";
    }
}
